"use strict"

/**
 * 承德政府采购网爬虫
 *  
 */

var Base = require("./base");
var cd_spider = new Base();
cd_spider.name = "承德政府采购网";
cd_spider.page = 2;

cd_spider.getPageUrl = function (pg) {
    var url = "http://www.chengde.gov.cn/zfcg/node_1028.htm";
    if (pg != 1) {
        url = "http://www.chengde.gov.cn/zfcg/node_1028_" + pg + ".htm";
    }
    return url;
}

cd_spider.getItems = function ($) {
    var items = [];
    $(".lmlb li a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.chengde.gov.cn/zfcg/" + e.attr("href");
        item.source = cd_spider.name;
        items.push(item);
    });
    return items;
}

exports = module.exports = cd_spider;